package com.qingcheng.service.impl;

import com.qingcheng.service.business.AdService;
import com.qingcheng.service.goods.CategoryService;
import com.qingcheng.service.goods.SkuService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Init implements InitializingBean {

    @Autowired
    private CategoryService categoryService;
//    @Autowired
//    private AdService adService;
    @Autowired
    private SkuService skuService;
    public void afterPropertiesSet() throws Exception {
    // 调用写入redis的方法
        categoryService.saveCategoryTreeToRedis();

//        adService.saveAdToRedisByPosition("web_index_lb");
        //同步价格到缓存
        skuService.saveAllPriceToRedis();

    }
}
